/* 回顾： 验证哥德巴赫猜想：任何一个大于6的偶数，都能分解成两个质数和。
 要求输入一个数，如果不满足大于6的偶数条件，则重新输入；
然后分解成两个质数相加的格式，类似  10=3+7这样*/
package ZUOYE0428;

import java.util.Scanner;

public class Review {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.print("输入一个数：");
		int num;
		while (true) {
			num = in.nextInt();
			if (num > 6 && num % 2 == 0) {
				break;
			}
			System.out.println("输入有误，请重新输入：");
		}
		boolean numone = true, numtwo = true;
		for (int a = 2; a <= num - 2; a++) {
			for (int b = 2; b * b <= a; b++) {
				if (a % b == 0) {
					numone = false;
				}
			}
			if (numone == true) {
				int c = num - a;
				for (int d = 2; d * d <= c; d++) {
					if (c % d == 0) {
						numtwo = false;
					}
				}
				if (numtwo == true) {
					System.out.print(num + "=" + a + "+" + c);
					break;
				}
				numtwo = true;
			}
			numone = true;
		}
	}
}
